import http from "@/utils/http";
//用户登录前端接口
export function login(identify, password,token,code) {
  //console.log('===>api==>login:' + identify + ',' + password)
  let params={
    identify:identify,
    password: password,
    token: token,
    code:code
  }

  return http.get('/api/user/auth',params);
}

//检查登录状态的接口
export function getInfo() {
  return http.get("/api/user/isLogin")
}

//用户注销的接口
export function logout() {
  return http.get('/api/user/logout')
}

//用户注册
export function reg(user) {
  console.log("--------api/users-----------")
  console.log("-----注册用户信息-----")
  console.log(user);
  //这里是调用后端的真实接口。
  return http.post('/api/user/reg', user);
}

//检查账号是否已经注册
export async function checkIdentifyCanReg(identify) {
  let params = {
    identify: identify
  };
  return http.get('/api/user/checkIsReg', params);
}

//更新用户资料
export function updateUserProfile(user){
  return http.put('/api/user/update',user);
}

//根据用户编号查询用户资料
export function queryUserProfile(uid){
  let params={
    uid: uid
  };
  return http.get('/api/user/profile',params);
}

export function queryAllUserList(){
  return http.get("/api/user/")
}





